package com.yonyou.byb.utils;


public class DocumentChange {

	public static org.dom4j.Document parse(org.w3c.dom.Document doc) throws Exception {    
		if (doc == null) {    
			return null;    
		}    
		org.dom4j.io.DOMReader xmlReader = new org.dom4j.io.DOMReader();    
		return xmlReader.read(doc);    
	}    

	public static org.w3c.dom.Document parse(org.dom4j.Document doc) throws Exception {    
		if (doc == null) {    
			return null;    
		}    
		java.io.StringReader reader = new java.io.StringReader(doc.asXML());    
		org.xml.sax.InputSource source = new org.xml.sax.InputSource(reader);    
		javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance();    
		javax.xml.parsers.DocumentBuilder documentBuilder = documentBuilderFactory. newDocumentBuilder();    
		return documentBuilder.parse(source);    
	} 
}
